<template>
  <el-select
    v-bind="controlProps"
    :model-value="modelValue"
    v-on="pureListeners"
    @update:modelValue="inputHandle"
  >
    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  </el-select>
</template>

<script setup>
import { usePureListenersAndAttr } from "@/utils";
const { pureAttrs, pureListeners } = usePureListenersAndAttr();
const { options, modelValue } = defineProps(["options", "modelValue"]);
const emits = defineEmits(["update:modelValue"]);
const controlProps = computed(() => ({
  clearable: true,
  ...pureAttrs,
}));
const inputHandle = (value) => {
  if (!pureListeners?.["update:modelValue"]) {
    emits("update:modelValue", value);
  }
};
</script>
